home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / src / mail / pine3.96.tar.gz / pine3.96.tar / pine3.96 / imap / non-ANSI / c-client / mmdf.h < prev    next >
C/C++ Source or Header  |  1994-09-19  |  5KB  |  164 lines

  1. /*
  2.  * Program:    MMDF mail routines
  3.  *
  4.  * Author:    Mark Crispin
  5.  *        Networks and Distributed Computing
  6.  *        Computing & Communications
  7.  *        University of Washington
  8.  *        Administration Building, AG-44
  9.  *        Seattle, WA  98195
  10.  *        Internet: MRC@CAC.Washington.EDU
  11.  *
  12.  * Date:    15 May 1993
  13.  * Last Edited:    17 June 1994
  14.  *
  15.  * Copyright 1994 by the University of Washington
  16.  *
  17.  *  Permission to use, copy, modify, and distribute this software and its
  18.  * documentation for any purpose and without fee is hereby granted, provided
  19.  * that the above copyright notice appears in all copies and that both the
  20.  * above copyright notice and this permission notice appear in supporting
  21.  * documentation, and that the name of the University of Washington not be
  22.  * used in advertising or publicity pertaining to distribution of the software
  23.  * without specific, written prior permission.  This software is made
  24.  * available "as is", and
  25.  * THE UNIVERSITY OF WASHINGTON DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED,
  26.  * WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT LIMITATION ALL IMPLIED
  27.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, AND IN
  28.  * NO EVENT SHALL THE UNIVERSITY OF WASHINGTON BE LIABLE FOR ANY SPECIAL,
  29.  * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  30.  * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, TORT
  31.  * (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF OR IN CONNECTION
  32.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  33.  *
  34.  */
  35.  
  36.  
  37. #define bezerk_local mmdf_local    /* must be before the include of bezerk.h */
  38. #define BEZERKLOCAL MMDFLOCAL
  39. #include "bezerk.h"        /* most of our stuff comes from this guy */
  40.  
  41. /* Supposedly, this page has everything the MMDF driver needs to know about
  42.  * the MMDF delimiter.  By changing these macros, the MMDF driver should
  43.  * change with it.  Note that if you change the length of MMDFHDRTXT you
  44.  * also need to change the ISMMDF and RETIFMMDFWRD macros to reflect the new
  45.  * size.
  46.  */
  47.  
  48.  
  49. /* Useful MMDF constants */
  50.  
  51. #define MMDFCHR '\01'        /* MMDF character */
  52. #define MMDFCHRS 0x01010101    /* MMDF header character spread in a word */
  53.                 /* MMDF header text */
  54. #define MMDFHDRTXT "\01\01\01\01\n"
  55.                 /* length of MMDF header text */
  56. #define MMDFHDRLEN sizeof (MMDFHDRTXT) - 1
  57.  
  58.  
  59. /* Validate MMDF header
  60.  * Accepts: pointer to candidate string to validate as an MMDF header
  61.  * Returns: T if valid; else NIL
  62.  */
  63.  
  64. #define ISMMDF(s)                            \
  65.   ((*(s) == MMDFCHR) && ((s)[1] == MMDFCHR) && ((s)[2] == MMDFCHR) &&    \
  66.    ((s)[3] == MMDFCHR) && ((s)[4] == '\n'))
  67.  
  68.  
  69. /* Return if a 32-bit word has the start of an MMDF header
  70.  * Accepts: pointer to word of four bytes to validate as an MMDF header
  71.  * Returns: pointer to MMDF header, else proceeds
  72.  */
  73.  
  74. #define RETIFMMDFWRD(s) {                        \
  75.   if (s[3] == MMDFCHR) {                        \
  76.     if ((s[4] == MMDFCHR) && (s[5] == MMDFCHR) && (s[6] == MMDFCHR) &&    \
  77.     (s[7] == '\n')) return s + 3;                    \
  78.     else if (s[2] == MMDFCHR) {                        \
  79.       if ((s[4] == MMDFCHR) && (s[5] == MMDFCHR) && (s[6] == '\n'))    \
  80.     return s + 2;                            \
  81.       else if (s[1] == MMDFCHR) {                    \
  82.     if ((s[4] == MMDFCHR) && (s[5] == '\n')) return s + 1;        \
  83.     else if ((*s == MMDFCHR) && (s[4] == '\n')) return s;        \
  84.       }                                    \
  85.     }                                    \
  86.   }                                    \
  87. }
  88.  
  89. /* Function prototypes */
  90.  
  91. DRIVER *mmdf_valid  ();
  92. int mmdf_isvalid  ();
  93. void *mmdf_parameters  ();
  94. void mmdf_find  ();
  95. void mmdf_find_bboards  ();
  96. void mmdf_find_all  ();
  97. void mmdf_find_all_bboards  ();
  98. long mmdf_subscribe  ();
  99. long mmdf_unsubscribe  ();
  100. long mmdf_subscribe_bboard  ();
  101. long mmdf_unsubscribe_bboard  ();
  102. long mmdf_create  ();
  103. long mmdf_delete  ();
  104. long mmdf_rename  ();
  105. MAILSTREAM *mmdf_open  ();
  106. void mmdf_close  ();
  107. void mmdf_fetchfast  ();
  108. void mmdf_fetchflags  ();
  109. ENVELOPE *mmdf_fetchstructure  ();
  110. char *mmdf_fetchheader  ();
  111. char *mmdf_fetchtext  ();
  112. char *mmdf_fetchbody ();
  113. void mmdf_setflag  ();
  114. void mmdf_clearflag  ();
  115. void mmdf_search  ();
  116. long mmdf_ping  ();
  117. void mmdf_check  ();
  118. void mmdf_expunge  ();
  119. long mmdf_copy  ();
  120. long mmdf_move  ();
  121. long mmdf_append  ();
  122. void mmdf_gc  ();
  123.  
  124. void mmdf_abort  ();
  125. char *mmdf_file  ();
  126. int mmdf_lock  ();
  127. void mmdf_unlock  ();
  128. int mmdf_parse  ();
  129. char *mmdf_eom  ();
  130. int mmdf_extend  ();
  131. void mmdf_save  ();
  132. int mmdf_copy_messages  ();
  133. int mmdf_write_message  ();
  134. void mmdf_update_status  ();
  135. short mmdf_getflags  ();
  136. char mmdf_search_all  ();
  137. char mmdf_search_answered  ();
  138. char mmdf_search_deleted  ();
  139. char mmdf_search_flagged  ();
  140. char mmdf_search_keyword  ();
  141. char mmdf_search_new  ();
  142. char mmdf_search_old  ();
  143. char mmdf_search_recent  ();
  144. char mmdf_search_seen  ();
  145. char mmdf_search_unanswered  ();
  146. char mmdf_search_undeleted  ();
  147. char mmdf_search_unflagged  ();
  148. char mmdf_search_unkeyword  ();
  149. char mmdf_search_unseen  ();
  150. char mmdf_search_before  ();
  151. char mmdf_search_on  ();
  152. char mmdf_search_since  ();
  153. char mmdf_search_body  ();
  154. char mmdf_search_subject  ();
  155. char mmdf_search_text  ();
  156. char mmdf_search_bcc  ();
  157. char mmdf_search_cc  ();
  158. char mmdf_search_from  ();
  159. char mmdf_search_to  ();
  160.  
  161. search_t mmdf_search_date  ();
  162. search_t mmdf_search_flag  ();
  163. search_t mmdf_search_string  ();
  164.